﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using CMS.BLL;

public partial class Controls_Testimonial_ctrTestimonialHomePage : System.Web.UI.UserControl
{
    private int nCurrentLanguage = Support.GetCurrentLanguage(); 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.BindTestimonial();
            SetLabel();
        }
    }

    private void SetLabel()
    {
        lblTestimonial.Text = MultipleLanguage.TESTIMONIAL[nCurrentLanguage - 1];
        lnkShowall.Text = MultipleLanguage.SHOWALL[nCurrentLanguage - 1];
        lnkShowall.NavigateUrl = "~/Testimonial.aspx";
    }
    private void BindTestimonial()
    {
        Testimonial objTest = new Testimonial();
        DataTable dtbTest = new DataTable();
        dtbTest = objTest.GetAll();
        int nCount = dtbTest.Rows.Count;
        lblTitle.Text = dtbTest.Rows[nCount - 1]["Title"].ToString();
        ltrTestimonial.Text = dtbTest.Rows[nCount - 1]["TestimonialContent"].ToString();

    }
}